//
//  CLUIBaseViewController.h
//  CityHunter
//
//  Updated by xcq on 14-10-22.
//  Copyright (c) 2014年 CieNet. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CLUIBaseTableViewController.h"
#import "ConfigDefine.h"
#import "CurrentDataSource.h"
#import <UIView+Toast.h>
#define Point @"1234567890/n"
#define RMB @"¥"
#import "LocationGetObj.h"
 

#define TOASTSHOW(value) [self.view makeToast:value duration:TOSTEDURATION position:TOP_POINT];


#define TOP_POINT [NSValue valueWithCGPoint:CGPointMake([UIScreen mainScreen].bounds.size.width / 2, ([UIScreen mainScreen].bounds.size.height  / 2.6) )]
#define TOSTEDURATION 1.0f
#define kTitleBarHeight 64.0
#define kBottomBarHeight                    44.0

#define kNavigationBarLeftBtnTag                1000
#define kNavigationBarRightBtnTag               1001
#define kRequestFailRetBtnTag                   9999

#ifndef GET_VIEW_RIGHT
#define GET_VIEW_RIGHT(view) (view.frame.origin.x + view.frame.size.width)
#endif
#ifndef GET_VIEW_BOTTOM
#define GET_VIEW_BOTTOM(view) (view.frame.origin.y + view.frame.size.height)
#endif
#define FrameHeight 64
#define INTCONVERSTR(value)     [NSString stringWithFormat:@"%d",value];



typedef enum PostRequestPropertyType {
    PostRequestPropertyJson,
    PostRequestPropertyXml
} PostRequestPropertyType;

@interface CLUIBaseViewController : UIViewController <UIGestureRecognizerDelegate,LocationDelegate,RequestorDelegate,UITextFieldDelegate>
@property (nonatomic, strong) CurrentDataSource *dataSource;
@property (nonatomic, retain) UIView *editingTextInputView;
@property (nonatomic ,retain) LocationGetObj *locService;
@property (nonatomic ,retain) CLLocationManager *locationManager;

 - (void)showNavBarWithRightTitle:(NSString *)rightTitle
                  andRightAction:(SEL)raction
                   andLeftAction:(SEL)laction
                       andCustom:(BOOL) bol;

- (void)showNavBarLeftImgAndRightTitle:(NSString*)title
                        andRightAction:(SEL)raction
                         andLeftAction:(SEL)laction
                           andLeftImge:(UIImage *)img;

- (void)showNavBarWithRightImage:(UIImage *)rimage
               andRightBtnAction:(SEL)raction
                   andRightBadge:(NSInteger)rnum
                    LeftBtnImage:(UIImage *)limage
                andLeftBtnAction:(SEL)laction
                     andLeftBage:(NSInteger)lnum
                           title:(NSString *)title
                        barColor:(UIColor *)color;

- (void)showNavBarWithRightTitle:(NSString *)rightTitle
                  andRightAction:(SEL)raction
                   andLeftAction:(SEL)laction
                     andFontSize:(CGFloat)size
                   andRightWidth:(CGFloat)width;

- (void)setNavBarBgImgView:(NSString *)imageStr;
- (void)showNavBarWithTitle:(NSString *)title;
- (void)setUp;
- (void)backTo;
- (void)rightBtnAction;

- (void)displayProgressHUD;
- (void)hideProgressHUD;
- (void)displayMask;
- (void)hideMask;
- (void)hideActionSheets;

- (BOOL)isPresent;
-(void)networkingStartHandleWithRequestIdentifier:(RequestIdentifier)identifier;
-(void)networkingCompleteHandleWithRequestIdentifier:(RequestIdentifier)identifier;
-(void)networkingFailureHandleWithRequestIdentifier:(RequestIdentifier)identifier errorMessage:(NSString *)message;
//- (void)popViewControllerAnimated:(BOOL)animated;
//- (void)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;
//- (UIViewController*)popToViewControllerKindClass:(id)viewControllerClass animated:(BOOL)animated;
//- (UIViewController*)popToViewControllerMemberClass:(id)viewControllerClass animated:(BOOL)animated;

- (void)retryLogin;

- (void)hideKeyboard;
- (void)keyboardWillChangeFrame:(NSNotification *)notification;
- (void)keyboardWillShow:(NSNotification *)notification;
- (void)keyboardWillHide:(NSNotification *)notification;

@end
